home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / tutor / pcl61b.arj / PART6.EXE / BUILDUT.TUT < prev    next >
Text File  |  1993-08-16  |  28KB  |  670 lines

  1.        
  2.        The following information is reprinted with permission, Ultimate 
  3.        Power Tips 1.0A (c) 1992, 1993  Paul Scanlon, Scanlon Enterprises 
  4.        
  5.        ---------------------------------------------------------------- 
  6.        
  7.                            BUILD YOUR OWN UTILITIES
  8.  
  9.        ---------------------------------------------------------------- 
  10.  
  11.        This is a section devoted to users who want the most from their 
  12.        system and want to learn about using the DOS debug program to 
  13.        create small, powerful utilities. Using debug and special debug 
  14.        scripts which are frequently found in computer magazines you can 
  15.        create your own software programs. You don't have to be a "power 
  16.        user" to use these utilities. Everything you need to create the 
  17.        utilities comes with DOS. 
  18.  
  19.         You'll need :
  20.  
  21.         1) DOS DEBUG.EXE (or DEBUG.COM)
  22.  
  23.         2) DOS EDLIN.COM (or any good text editor)
  24.  
  25.         3) Some free disk space
  26.  
  27.        The DOS DEBUG program, is very well known in Power User Circles, 
  28.        and amongst programmers. Now, it is time, for everyone else to 
  29.        learn the potential of this FREE program, that is included with 
  30.        Microsoft DOS. 
  31.  
  32.        DEBUG is a tool designed for aiding the programmer in debugging 
  33.        software. Because Microsoft designed more into it, it is often 
  34.        used as a compiler! Yes, you can write a program in assembly 
  35.        language, and compile it, without even going out and buying a 
  36.        compiler. Actually, since we are talking about assembly 
  37.        language, this technique is called Assembling, instead of 
  38.        compiling. After making your first utility, from this section, 
  39.        you may call yourself a programmer! Not only that, you can say, 
  40.        that you've programmed in Assembly Language, the hardest of all 
  41.        programming languages! 
  42.  
  43.        The purpose of this section, is NOT to provide you with detailed 
  44.        workings of DEBUG, as powerful as it may be, but to provide you 
  45.        with enough knowledge to create the utilities. 
  46.  
  47.        To create these utilities, you'll be using a command line (DOS 
  48.        prompt) similar to the following : 
  49.  
  50.                 DEBUG < filename
  51.  
  52.         Where, 'filename' is the name of the file we tell you to create 
  53.        using a text editor (or EDLIN). The redirector symbol < is used, 
  54.        because we are going to pretend we are entering the keystrokes 
  55.        found in the file 'filename'. Actually, we have, but, we have 
  56.        done so, in advance. The redirector tells DOS, to get keyboard 
  57.        input from the file 'filename', instead of the actual keyboard. 
  58.        
  59.        Here's a tip: you can use your word processor to "cut and 
  60.        extract" the debug scripts presented below from this larger PC-
  61.        Learn tutorial file (BUILDUT.TUT) into a smaller standard ASCII 
  62.        text file also called a script file. Be sure to move all text 
  63.        lines of the script file flush left (to the far left of the 
  64.        screen) and use only the script data as presented. Save the new 
  65.        file which will become your debug script file. To cut or clip 
  66.        the script from the larger PC-Learn tutorial you will usually 
  67.        use the "mark block" and "cut block" capability of your word 
  68.        processor to "clip" it from the main PC-Learn tutorial and save 
  69.        it into a smaller file. 
  70.  
  71.         Let us begin, now, with our first program!
  72.  
  73.         Get Available Memory Quickly
  74.        
  75.         Name this script file (that's what we call a file we use to 
  76.         execute DEBUG automatically), FM.SCR (for FreeMemory).
  77.        You can either type it in manually to a ASCII text file using 
  78.        your word processor or use the tip above.
  79.  
  80.        Name of file you will create: FM.SCR
  81.  
  82.  
  83.                 N FM.COM
  84.                 E 100 EB 09 90 4B 20
  85.                 E 105 46 72 65 65 24
  86.                 E 10A 0A 2E A1 02 00
  87.                 E 10F 8C CB 2B C3 B1
  88.                 E 114 06 D3 E8 B9 01
  89.                 E 119 00 F6 36 0A 01
  90.                 E 11E 50 0A C0 74 05
  91.                 E 123 32 E4 41 EB F2
  92.                 E 128 58 8A D4 80 C2
  93.                 E 12D 30 B4 02 CD 21
  94.                 E 132 E2 F4 B4 09 BA
  95.                 E 137 03 01 CD 21 C3
  96.                 RCX
  97.                 3C
  98.                 W
  99.                 Q
  100.  
  101.        If you copied this correctly, you will have created your first 
  102.        DEBUG script file. You may be wondering what all those 
  103.        alphabetic characters are doing mixed in with the numbers (if 
  104.        you are a programmer or power user, you already know). We are 
  105.        using what is referred to as HEX numbers, which is a numbering 
  106.        system based upon 16, rather that our usual base 10 (digits 0-
  107.        9). For the program to work, a complete understanding, is NOT 
  108.        necessary. 
  109.  
  110.        This little script, will create a program, FM.COM, which, when 
  111.        executed, will display the amount of available memory. By 
  112.        creating this program, you will no longer have to execute the 
  113.        DOS program CHKDSK to get the memory available. For those of you 
  114.        with newer DOS 5.0, you have the DOS program MEM which reports 
  115.        this value. However, the DOS MEM program is NOT 60 bytes long! 
  116.        Yes, we did say 60 bytes. The DOS MEM program is almost 40K 
  117.        bytes! Throw out that disk hog, and use FM which is smaller.
  118.  
  119.        Well, we have the script in a small text file, but, how do we 
  120.        make the program? Easy, just enter the following line : 
  121.  
  122.                 DEBUG<FM.SCR
  123.  
  124.        When executed, as above, your display should have the following 
  125.        lines displayed. 
  126.  
  127.                 CXC000003 01 CD 21 C3
  128.                 Writing 0003C bytes
  129.                 -Q
  130.        
  131.        If your screen differs from the above, recheck the script file, 
  132.        you created, with the earlier text (above) in this tutorial. 
  133.  
  134.        Debug will create the new file FM.COM which is the actual 
  135.        utility program. To run it just type FM.
  136.  
  137.        Now, when you want to know the amount of available ram, you 
  138.        simply enter "FM" and press <ENTER> at any DOS prompt. For those 
  139.        of you who do have DOS 5.0 and the program MEM, and have noticed 
  140.        a discrepancy in available size reporting, remember, MEM is 
  141.        reporting BYTES FREE, and FM is reporting K (thousands) of bytes 
  142.        free! To verify that FM is indeed reporting accurately, simply 
  143.        divide the reported amount by MEM, by 1024, to get K bytes as 
  144.        reported by FM. You'll see, these numbers are the same! 
  145.      
  146.  
  147.         Num Lock Off
  148.  
  149.         If you are using one of those 84 key (old time keyboards), or 
  150.         simply prefer to use cursor positioning from the numeric keypad, 
  151.         and want to make sure that your NumLock is Off at boot time, 
  152.         create the following DEBUG script file. We will name the script 
  153.         file "NN.SCR" for no num lock, which will make the program 
  154.         "NN.COM".
  155.  
  156.         NN.SCR
  157.  
  158.                 A 100
  159.                 MOV AX,0
  160.                 MOV DS,AX
  161.                 AND BYTE PTR[417],DF
  162.                 INT 20
  163.                 {empty line}
  164.                 RCX
  165.                 C
  166.                 N NN.COM
  167.                 W
  168.                 Q
  169.  
  170.         Be sure to leave the line with "{empty line}", blank. Just press 
  171.         the <ENTER> key for that line. We use "NN", as the name, for No 
  172.         Num Lock.
  173.  
  174.         Now, from a DOS prompt, type : DEBUG<NN.SCR
  175.  
  176.         You should see the following display after typing the above.
  177.  
  178.  
  179.                 CXC00000C INT 20TEXPTR[417],DF
  180.                 WritingO0000C bytes
  181.                 -Q
  182.  
  183.         If your screen differs from the above, recheck the script file, 
  184.         you created, with the earlier text (above) in this tutorial.
  185.  
  186.         Now, all you have to do is enter NN <ENTER> at a DOS prompt to 
  187.         set num lock off. The best use, is to put NN on a line of your 
  188.         AUTOEXEC.BAT file, and have AUTOEXEC automatically set num lock 
  189.         off at boot time.
  190.  
  191.        Whoa! Notice the difference between this script and our earlier 
  192.        one? The first example, was using hex input, and here, we use, 
  193.        what is called assembly language. The difference between these 
  194.        two approaches, is invisible to you, the user. This tutorial, 
  195.        will intermix the two types of script files, Hex and Assembly, 
  196.        so you will become familiar with them. In this way, you'll be 
  197.        able to quickly enter them, from a magazine article. Computer 
  198.        magazines frequently have lots of practical debug script files 
  199.        you can try!
  200.  
  201.        Lets take a moment, to cover two DEBUG script lines, the "RCX" 
  202.        and "N". The line containing "RCX" tells DEBUG, that we wish to 
  203.        set the number of bytes, for a file size, in this case, "C", 
  204.        next line, which is 12 decimal. Thus, we will have created a COM 
  205.        file (NN.COM), which is only 12 bytes long! 
  206.  
  207.  
  208.         Faster Repeat Keys
  209.  
  210.         This script file, will create a program to speed up repeat keys. 
  211.         Repeat keys, are keys which can be held down, and automatically 
  212.         duplicate characters. IE...Hold down the letter "k", soon, the 
  213.         screen will start filling up with "k". Now release the "k" key, 
  214.         and "k"'s stop appearing. The speed at which the k's appear, is 
  215.         called the repeat rate, which is what this program will speed 
  216.         up. We will call this script file FK.SCR, and it will make a 
  217.         program called FK.COM (for Fast Keys).
  218.  
  219.         FK.SCR
  220.  
  221.                 A 100
  222.                 MOV AX,305
  223.                 MOV BX,3
  224.                 INT 16
  225.                 INT 20
  226.                 {blank line}
  227.                 RCX
  228.                 A
  229.                 N FK.COM
  230.                 W
  231.                 Q
  232.  
  233.         Now, type : DEBUG<FK.SCR
  234.  
  235.         If your script file is right, you'll see the following displayed
  236.  
  237.  
  238.                 CXC00000A INT 20,305
  239.                 WritingO0000A bytes
  240.                 -Q
  241.         If your screen differs, then you have entered the script file 
  242.         incorrectly. If everything goes right, you can now enter FK and 
  243.         press <ENTER> at any DOS prompt, to speed up your key board 
  244.         repeat keys. However, to automatically, have this performed at 
  245.         boot time would be better. To do this, just place a line, with 
  246.         FK into your AUTOEXEC.BAT file, and from then on, each time you 
  247.         boot, you'll have the repeat keys speeded up.
  248.  
  249.  
  250.         Lost Cursor Recovery
  251.  
  252.         If you, like me, have had your cursor become invisible after 
  253.         executing some program, would like some way to get it back, then 
  254.         enter this script. This script will create a program, that not 
  255.         only recovers the cursor, but will restore a screen from 
  256.         graphics mode, which some games leave it in.
  257.  
  258.  
  259.         The following script is named RC.SCR, for Recover Cursor, and 
  260.         creates a program called "RC.COM".
  261.  
  262.         RC.SCR
  263.  
  264.                 A 100
  265.                 MOV AX,3
  266.                 INT 10
  267.                 INT 20
  268.                 {Blank line}
  269.                 RCX
  270.                 7
  271.                 N RC.COM
  272.                 W
  273.                 Q
  274.  
  275.         This creates the smallest program yet, only 7 bytes! Now, to 
  276.         use, simply enter RC and press <ENTER> from a DOS prompt. No 
  277.         need to have this as part of your AUTOEXEC, unless your AUTOEXEC 
  278.         starts something which leaves the screen in graphics mode. To 
  279.         get the best use of this utility, we suggest creating a batch 
  280.         file to start your game or application which leaves the screen 
  281.         in graphics mode, or makes the cursor invisible. If your program 
  282.         is named "GO.EXE" then your batch file would look like this.
  283.  
  284.                 GO
  285.                 RC
  286.  
  287.         Just a simple two line batch file! 
  288.  
  289.         For those of you familiar with programming, you'll notice, the 
  290.         code set attempts to reset the mode to MODE 3, which is 80 
  291.         column by 25 line color mode. We haven't made an error, do NOT 
  292.         change anything. If you have a monochrome system, this will 
  293.         reset that back to monochrome mode! Go ahead and try it.
  294.  
  295.        
  296.         Comparing The Size of Two Files
  297.  
  298.         Have you ever needed to compare the size of two different files? 
  299.         This script file will create a program which will do just that. 
  300.         The program, once created, will display the size difference 
  301.         between two files. Create the script file FD.SCR (for File 
  302.         Difference), which then can be used, with DEBUG to create 
  303.         FD.COM.
  304.  
  305.  
  306.  
  307.  
  308.  
  309.         FD.SCR
  310.                 N FD.COM
  311.                 E 100 EB 5F 90 00 00 00 00 00
  312.                 E 108 00 00 00 53 79 6E 74 61
  313.                 E 110 78 3A 20 46 44 20 66 69
  314.                 E 118 6C 65 31 20 66 69 6C 65
  315.                 E 120 32 0D 0A 24 00 00 00 00
  316.                 E 128 00 00 46 69 6C 65 20 4E
  317.                 E 130 4F 54 20 66 6F 75 6E 64
  318.                 E 138 20 6F 72 20 46 69 6C 65
  319.                 E 140 20 4F 70 65 6E 20 45 72
  320.                 E 148 72 6F 72 0D 0A 24 44 69
  321.                 E 150 66 20 3A 20 24 24 20 42
  322.                 E 158 79 74 65 73 0D 0A 24 00
  323.                 E 160 00 FC BE 81 00 E8 AC 00
  324.                 E 168 73 0C B4 09 BA 0B 01 CD
  325.                 E 170 21 B8 02 4C CD 21 89 36
  326.                 E 178 03 01 FF 0E 03 01 E8 86
  327.                 E 180 00 72 E7 C6 44 FF 00 E8
  328.                 E 188 8A 00 72 DE 89 36 05 01
  329.                 E 190 FF 0E 05 01 E8 70 00 73
  330.                 E 198 06 80 7C FF 0D 75 CB C6
  331.                 E 1A0 44 FF 00 8B 16 03 01 E8
  332.                 E 1A8 77 00 73 07 B4 09 BA 2A
  333.                 E 1B0 01 EB BC A3 07 01 89 16
  334.                 E 1B8 09 01 8B 16 05 01 E8 60
  335.                 E 1C0 00 72 E9 8B 1E 07 01 8B
  336.                 E 1C8 0E 09 01 3B CA 77 0E 72
  337.                 E 1D0 04 3B D8 73 08 93 86 CA
  338.                 E 1D8 C6 06 54 01 2D 2B D8 1B
  339.                 E 1E0 CA 53 51 B4 09 BA 4E 01
  340.                 E 1E8 CD 21 E8 4D 00 B4 09 BA
  341.                 E 1F0 56 01 CD 21 59 5B B8 00
  342.                 E 1F8 4C 0B DB 75 06 0B C9 75
  343.                 E 200 02 CD 21 B0 01 CD 21 AC
  344.                 E 208 3C 20 74 06 3C 0D 75 F7
  345.                 E 210 F9 C3 F8 C3 AC 3C 20 74
  346.                 E 218 FB 3C 0D 75 02 F9 C3 F8
  347.                 E 220 C3 B8 00 3D CD 21 72 11
  348.                 E 228 8B D8 B8 02 42 2B C9 2B
  349.                 E 230 D2 CD 21 50 B4 3E CD 21
  350.                 E 238 58 C3 8B D1 8B C3 FF 06
  351.                 E 240 5F 01 8B DA 2B C9 2B D2
  352.                 E 248 2B F6 BF 0A 00 E8 18 00
  353.                 E 250 53 0B C0 75 E9 0B D2 75
  354.                 E 258 E5 8B 0E 5F 01 5A 80 C2
  355.                 E 260 30 B4 02 CD 21 E2 F6 C3
  356.                 E 268 8B E9 B9 20 00 F8 D1 D0
  357.                 E 270 D1 D3 D1 D5 D1 D2 73 0A
  358.                 E 278 2B EF 1B D6 F9 E2 EF EB
  359.                 E 280 0E 90 3B D6 72 06 75 F0
  360.                 E 288 3B EF 73 EC F8 E2 DF D1
  361.                 E 290 D0 D1 D3 8B CD 87 D3 87
  362.                 E 298 CB C3
  363.                 RCX
  364.                 19A
  365.                 W
  366.                 Q
  367.  
  368.         This DEBUG script file, is fairly lengthy, as script files goes, 
  369.         so please be careful when entering it. Should you have problems, 
  370.         we strongly suggest you use a wordprocessor to extract the above 
  371.         and use the resultant file with DEBUG directly with DEBUG. If 
  372.         you have entered the above correctly, and execute the command 
  373.         "DEBUG<FD.SCR" you'll see the following display.
  374.  
  375.  
  376.  
  377.                 -N FD.COM
  378.                 -E 100 EB 5F 90 00 00 00 00 00
  379.                 -E 108 00 00 00 53 79 6E 74 61
  380.                 -E 110 78 3A 20 46 44 20 66 69
  381.                 -E 118 6C 65 31 20 66 69 6C 65
  382.                 -E 120 32 0D 0A 24 00 00 00 00
  383.                 -E 128 00 00 46 69 6C 65 20 4E
  384.                 -E 130 4F 54 20 66 6F 75 6E 64
  385.                 -E 138 20 6F 72 20 46 69 6C 65
  386.                 -E 140 20 4F 70 65 6E 20 45 72
  387.                 -E 148 72 6F 72 0D 0A 24 44 69
  388.                 -E 150 66 20 3A 20 24 24 20 42
  389.                 -E 158 79 74 65 73 0D 0A 24 00
  390.                 -E 160 00 FC BE 81 00 E8 AC 00
  391.                 -E 168 73 0C B4 09 BA 0B 01 CD
  392.                 -E 170 21 B8 02 4C CD 21 89 36
  393.                 -E 178 03 01 FF 0E 03 01 E8 86
  394.                 -E 180 00 72 E7 C6 44 FF 00 E8
  395.                 -E 188 8A 00 72 DE 89 36 05 01
  396.                 -E 190 FF 0E 05 01 E8 70 00 73
  397.                 -E 198 06 80 7C FF 0D 75 CB C6
  398.                 -E 1A0 44 FF 00 8B 16 03 01 E8
  399.                 -E 1A8 77 00 73 07 B4 09 BA 2A
  400.                 -E 1B0 01 EB BC A3 07 01 89 16
  401.                 -E 1B8 09 01 8B 16 05 01 E8 60
  402.                 -E 1C0 00 72 E9 8B 1E 07 01 8B
  403.                 -E 1C8 0E 09 01 3B CA 77 0E 72
  404.                 -E 1D0 04 3B D8 73 08 93 86 CA
  405.                 -E 1D8 C6 06 54 01 2D 2B D8 1B
  406.                 -E 1E0 CA 53 51 B4 09 BA 4E 01
  407.                 -E 1E8 CD 21 E8 4D 00 B4 09 BA
  408.                 -E 1F0 56 01 CD 21 59 5B B8 00
  409.                 -E 1F8 4C 0B DB 75 06 0B C9 75
  410.                 -E 200 02 CD 21 B0 01 CD 21 AC
  411.                 -E 208 3C 20 74 06 3C 0D 75 F7
  412.                 -E 210 F9 C3 F8 C3 AC 3C 20 74
  413.                 -E 218 FB 3C 0D 75 02 F9 C3 F8
  414.                 -E 220 C3 B8 00 3D CD 21 72 11
  415.                 -E 228 8B D8 B8 02 42 2B C9 2B
  416.                 -E 230 D2 CD 21 50 B4 3E CD 21
  417.                 -E 238 58 C3 8B D1 8B C3 FF 06
  418.                 -E 240 5F 01 8B DA 2B C9 2B D2
  419.                 -E 248 2B F6 BF 0A 00 E8 18 00
  420.                 -E 250 53 0B C0 75 E9 0B D2 75
  421.                 -E 258 E5 8B 0E 5F 01 5A 80 C2
  422.                 -E 260 30 B4 02 CD 21 E2 F6 C3
  423.                 -E 268 8B E9 B9 20 00 F8 D1 D0
  424.                 -E 270 D1 D3 D1 D5 D1 D2 73 0A
  425.                 -E 278 2B EF 1B D6 F9 E2 EF EB
  426.                 -E 280 0E 90 3B D6 72 06 75 F0
  427.                 -E 288 3B EF 73 EC F8 E2 DF D1
  428.                 -E 290 D0 D1 D3 8B CD 87 D3 87
  429.                 -E 298 CB C3
  430.                 -RCX
  431.                 CX 0000
  432.                 :19A
  433.                 -W
  434.                 Writing 0019A bytes
  435.                 -Q
  436.  
  437.         After executing DEBUG with the script file, you are now ready to 
  438.         use FD.COM. To use, enter the following command syntax:
  439.  
  440.                 FD file1 file2
  441.  
  442.  
  443.         This will display the file size difference between 'file1' and 
  444.         'file2'. If 'file1' is larger than 'file2' the difference is 
  445.         displayed as a positive value. If 'file1' is smaller than 
  446.         'file2' then the difference is displayed as a negative number. 
  447.         In addition, the program will set an ERRORLEVEL which can be 
  448.         tested from a batch file. The ERRORLEVEL will be "0" if the 
  449.         files are exactly the same size, "1" if the files are not the 
  450.         same size, and "2" if there is an error, such as file not found 
  451.         or can't be read.
  452.  
  453.  
  454.         Combining the DOS Environment, With Keyboard Input
  455.  
  456.         Sometimes, it is important to ask questions in a batch file, 
  457.         but, DOS doesn't have any batch file keyboard input, except the 
  458.         almost useless PAUSE command which waits for any key. PAUSE does 
  459.         nothing with the keystroke! This script file, IN.SCR, will 
  460.         create IN.COM. In DOS 6.0 a new utility CHOICE offers the same 
  461.         capbility.
  462.  
  463.         IN.SCR
  464.                 N IN.COM
  465.                 E 100 FC B4 0E B3 0F BE 81 00
  466.                 E 108 AC 3C 20 74 FB 3C 0D 74
  467.                 E 110 05 CD 10 AC EB F7 33 C9
  468.                 E 118 BF 80 00 32 E4 CD 16 0A
  469.                 E 120 C0 74 3D B4 0E 3C 08 74
  470.                 E 128 42 3C 0D 74 13 3C 03 74
  471.                 E 130 2A 3C 20 72 E6 83 F9 7F
  472.                 E 138 74 2A AA 41 CD 10 EB DB
  473.                 E 140 CD 10 B0 0A CD 10 B4 09
  474.                 E 148 BA 7B 01 CD 21 B4 02 E3
  475.                 E 150 0A BE 80 00 AC 86 D0 CD
  476.                 E 158 21 E2 F9 B8 00 4C CD 21
  477.                 E 160 0A E4 74 F7 B8 07 0E CD
  478.                 E 168 10 EB B0 E3 F7 B0 08 CD
  479.                 E 170 10 B0 20 CD 10 49 4F B0
  480.                 E 178 08 EB C1 53 45 54 20 41
  481.                 E 180 53 4B 3D 24 90 90 90 90
  482.                 RCX
  483.                 84
  484.                 W
  485.                 Q
  486.  
  487.         If you have entered the above correctly, and execute the 
  488.         following command : DEBUG<IN.SCR  you will see the following 
  489.         screen displayed.
  490.  
  491.                 CXC000053 4B 3D 24 90 90 90 90
  492.                 Writing 00084 bytes
  493.                 -Q
  494.         Now, you are ready to use IN.COM. This program will allow a user 
  495.         to enter a string of text, such as a name, password, etc... To 
  496.         use this program, you must use the DOS redirector, to force the 
  497.         output of IN, to a file. When this is done, you'll end up with a 
  498.         one line file like this :
  499.  
  500.                 SET ASK=input
  501.  
  502.         Where 'input' is what the user entered.
  503.  
  504.         For instance, you want to ask the user their name, you'd create 
  505.         a batch file with these lines :
  506.  
  507.                 IN What is your name ? > NAME.BAT
  508.                 CALL NAME.BAT
  509.                 ECHO Why Hello %ASK%!
  510.  
  511.         The first line passes a question to our new program IN.COM, 
  512.         which sends its output to the file NAME.BAT, via the redirector 
  513.         ">". If the user responds with "Jeff" to the question, then the 
  514.         batch file "NAME.BAT" will contain "SET ASK=Jeff". The second 
  515.         line of the batch file, under DOS 3.3 and up, calls the new 
  516.         batch file just created from the first line. This batch file, 
  517.         executes the one line, "SET ASK=Jeff", which places "Jeff" into 
  518.         the environment variable ASK. Now, the final line can display 
  519.         the result, by embedding the variable name ASK inside "%" 
  520.         characters. This is how a batch file uses an environment 
  521.         variable. The variable name will be replaced by the contents of 
  522.         the variable, "Jeff". Thus our screen would display :
  523.  
  524.                 Why Hello Jeff!
  525.  
  526.         And NOT : Why Hello %ASK%!
  527.  
  528.         By using this program, your batch files can add that personal 
  529.         touch. Other uses, of course, include password input, selecting 
  530.         a directory name, and almost anything you can think of, which 
  531.         requires a line of input.
  532.        
  533.  
  534.         The Forgotten Rename Feature
  535.  
  536.        Older versions of DOS forgot one important function, Directory 
  537.        Rename. This function is suitable for DOS 3.0 and up. If you 
  538.        have an earlier DOS, why NOT upgrade NOW! We'll call our final 
  539.        script file "DR.SCR" for Directory Rename, which will create 
  540.        "DR.COM" when used with DEBUG. 
  541.        
  542.  
  543.         DR.SCR
  544.  
  545.                 N DR.COM
  546.                 E 100 E9 86 00 00 52 65 71 75
  547.                 E 108 69 72 65 73 20 44 4F 53
  548.                 E 110 20 33 2E 30 20 61 6E 64
  549.                 E 118 20 75 70 0D 0A 24 00 55
  550.                 E 120 73 61 67 65 20 3A 20 52
  551.                 E 128 44 20 5B 64 3A 5D 5B 70
  552.                 E 130 61 74 68 5D 6F 72 67 6E
  553.                 E 138 61 6D 65 20 6E 65 77 6E
  554.                 E 140 61 6D 65 0D 0A 24 00 00
  555.                 E 148 00 00 20 69 73 20 4E 4F
  556.                 E 150 54 20 61 20 64 69 72 65
  557.                 E 158 63 74 6F 72 79 0D 0A 24
  558.                 E 160 00 00 00 44 69 72 65 63
  559.                 E 168 74 6F 72 79 20 4E 4F 54
  560.                 E 170 20 66 6F 75 6E 64 20 6F
  561.                 E 178 72 20 49 4E 56 41 4C 49
  562.                 E 180 44 20 70 61 74 68 0D 0A
  563.                 E 188 24 B8 00 30 CD 21 3C 03
  564.                 E 190 73 0C BA 0E 01 B4 09 CD
  565.                 E 198 21 B8 01 4C CD 21 BE 81
  566.                 E 1A0 00 FC E8 5B 00 73 05 BA
  567.                 E 1A8 1F 01 EB E9 89 F2 4A E8
  568.                 E 1B0 41 00 72 F3 C6 44 FF 00
  569.                 E 1B8 89 F3 E8 43 00 72 E8 EE
  570.                 E 1C0 FE 4F E8 2E 00 73 06 80
  571.                 E 1C8 7C FF 0D 75 DA C6 44 FF
  572.                 E 1D0 00 B8 00 43 CD 21 F7 C1
  573.                 E 1D8 10 00 75 0D C6 47 FF 24
  574.                 E 1E0 B4 09 CD 21 BA 4A 01 EB
  575.                 E 1E8 AC B4 56 CD 21 BA 63 01
  576.                 E 1F0 72 A3 C3 AC 3C 20 74 06
  577.                 E 1F8 3C 0D 75 F7 F9 C3 F8 C3
  578.                 E 200 AC 3C 20 74 FB 3C 00 75
  579.                 E 208 02 F9 C3 F8 C3 90 90 90
  580.                 RCX
  581.                 10D
  582.                 W
  583.                 Q
  584.  
  585.         Again, using DEBUG, enter the following command.
  586.  
  587.                 DEBUG<DR.SCR
  588.  
  589.         You should see the following screen displayed
  590.  
  591.                 -N DR.COM
  592.                 -E 100 E9 86 00 00 52 65 71 75
  593.                 -E 108 69 72 65 73 20 44 4F 53
  594.                 -E 110 20 33 2E 30 20 61 6E 64
  595.                 -E 118 20 75 70 0D 0A 24 00 55
  596.                 -E 120 73 61 67 65 20 3A 20 52
  597.                 -E 128 44 20 5B 64 3A 5D 5B 70
  598.                 -E 130 61 74 68 5D 6F 72 67 6E
  599.                 -E 138 61 6D 65 20 6E 65 77 6E
  600.                 -E 140 61 6D 65 0D 0A 24 00 00
  601.                 -E 148 00 00 20 69 73 20 4E 4F
  602.                 -E 150 54 20 61 20 64 69 72 65
  603.                 -E 158 63 74 6F 72 79 0D 0A 24
  604.                 -E 160 00 00 00 44 69 72 65 63
  605.                 -E 168 74 6F 72 79 20 4E 4F 54
  606.                 -E 170 20 66 6F 75 6E 64 20 6F
  607.                 -E 178 72 20 49 4E 56 41 4C 49
  608.                 -E 180 44 20 70 61 74 68 0D 0A
  609.                 -E 188 24 B8 00 30 CD 21 3C 03
  610.                 -E 190 73 0C BA 0E 01 B4 09 CD
  611.                 -E 198 21 B8 01 4C CD 21 BE 81
  612.                 -E 1A0 00 FC E8 5B 00 73 05 BA
  613.                 -E 1A8 1F 01 EB E9 89 F2 4A E8
  614.                 -E 1B0 41 00 72 F3 C6 44 FF 00
  615.                 -E 1B8 89 F3 E8 43 00 72 E8 EE
  616.                 -E 1C0 FE 4F E8 2E 00 73 06 80
  617.                 -E 1C8 7C FF 0D 75 DA C6 44 FF
  618.                 -E 1D0 00 B8 00 43 CD 21 F7 C1
  619.                 -E 1D8 10 00 75 0D C6 47 FF 24
  620.                 -E 1E0 B4 09 CD 21 BA 4A 01 EB
  621.                 -E 1E8 AC B4 56 CD 21 BA 63 01
  622.                 -E 1F0 72 A3 C3 AC 3C 20 74 06
  623.                 -E 1F8 3C 0D 75 F7 F9 C3 F8 C3
  624.                 -E 200 AC 3C 20 74 FB 3C 00 75
  625.                 -E 208 02 F9 C3 F8 C3 90 90 90
  626.                 -RCX
  627.                 CX 0000
  628.                 :10D
  629.                 -W
  630.                 Writing 0010D bytes
  631.                 -Q
  632.  
  633.         Don't forget, this program you created requires DOS 3.0 and 
  634.         later. Now that we have this utility, we can start renaming 
  635.         directories. To use DR.COM you enter a command line similar to 
  636.         the following :
  637.  
  638.                 DR olddir newdir
  639.  
  640.         Where 'olddir' is the current directory name, including drive 
  641.         and path, 'newdir' is the new name to call it.
  642.  
  643.         EXAMPLE: If you have a directory called BUG and want to rename 
  644.         it BUGGED, you enter :
  645.  
  646.                 DR BUG BUGGED
  647.  
  648.         And, if your directory is D:\FILES\HOPE and you want it to 
  649.         change HOPE to HOPEFUL, then you'd enter :
  650.  
  651.                 DR D:\FILES\HOPE HOPEFUL
  652.  
  653.         (The new path will be "D:\FILES\HOPEFUL")
  654.  
  655.  
  656.         In this fashion, we can rename a directory, which is NOT on the 
  657.         current drive.
  658.  
  659.        
  660.        Tutorial finished. Have you registered PC-Learn to receive your
  661.        bonus disks? Registration is encouraged. Shareware works on the
  662.        honor system! Send $25 to Seattle Scientific Photography, 
  663.        Department PCL6, PO Box 1506, Mercer Island, WA 98040. Latest 
  664.        version of PC-Learn and two bonus disks shipped promptly!
  665.  
  666.        
  667.  
  668.  
  669.  
  670.